/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import utils.TableModel;

/**
 *
 * @author juju
 */
public class Client {
    protected int _id;
    protected String _Prenom;
    protected String _Nom;
    protected String _dateNaissance;
    protected String _login;
    protected String _password;
    private ClientMapper mapper;
    
    public Client() {
        this.mapper = new ClientMapper();
    }

    public String getLogin() {
        return _login;
    }

    public void setLogin(String _login) {
        this._login = _login;
    }
    
    

    public int getId() {
        return _id;
    }

    public void setId(int _id) {
        this._id = _id;
    }

    public String getPrenom() {
        return _Prenom;
    }

    public void setPrenom(String _Prenom) {
        this._Prenom = _Prenom;
    }

    public String getNom() {
        return _Nom;
    }

    public void setNom(String _Nom) {
        this._Nom = _Nom;
    }

    public String getDateNaissance() {
        return _dateNaissance;
    }

    public void setDateNaissance(String _dateNaissance) {
        this._dateNaissance = _dateNaissance;
    }

    public String getPassword() {
        return _password;
    }

    public void setPassword(String _password) {
        this._password = _password;
    }
    
    
    
    public TableModel fetchAll() {
        return mapper.fetchAll();
    }
    
    public void find(int id) {
        try {
            this.mapper.find(id, this);
        } catch (SQLException ex) {
            Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public void save() {
        mapper.save(this);
    }
}
